package com.shop.cereshop.commons.domain.im.tx.req.enums;

import lombok.Getter;
import lombok.Setter;


public enum ReqUrlEnums {
    BASE_URL(0, "console.tim.qq.com/", "SDKAppID 所在国家/地区对应的专属域名："),
    //导入单个账号  v4/im_open_login_svc/account_import,
    ACCOUNT_IMPORT(1, "v4/im_open_login_svc/account_import", "导入单个账号"),
    //查询账号 v4/im_open_login_svc/account_check
    ACCOUNT_CHECK(2, "v4/im_open_login_svc/account_check", "查询账号"),
    //导入多个账号 v4/im_open_login_svc/multiaccount_import
    MULTIACCOUNT_IMPORT(3, "v4/im_open_login_svc/multiaccount_import", "导入多个账号"),
    //删除账号。v4/im_open_login_svc/account_delete
    ACCOUNT_DELETE(4, "v4/im_open_login_svc/account_delete", "删除账号"),
    //添加好友 v4/sns/friend_add
    FRIEND_ADD(5, "v4/sns/friend_add", "添加好友"),
    //拉取好友 v4/sns/friend_get
    FRIEND_GET(6, "v4/sns/friend_get", "拉取好友"),
    //拉取指定好友
    FRIEND_GET_LIST(16, "v4/sns/friend_get_list", "拉取指定好友"),
    //单发单聊消息
    SINGLE_SEND_MSG(7, "v4/openim/sendmsg", "单发单聊消息"),
    //修改单聊历史消息
    MODIFY_C2C_MSG(19, "v4/openim/modify_c2c_msg", "修改单聊历史消息"),
    //修改群聊历史消息
    MODIFY_GROUP_MSG(20, "v4/openim/modify_group_msg", "修改群聊历史消息"),
    //发送群聊消息
    GROUP_SEND_MSG(17, "v4/group_open_http_svc/send_group_msg", "发送群聊消息"),
    //设置全局禁言
    SET_GLOBAL_BAN(8, "v4/openconfigsvr/setnospeaking", "设置全局禁言"),
    //查询用户全局禁言
    GET_USER_SPEAKING(18, "v4/openconfigsvr/getnospeaking", "查询用户全局禁言"),
    //推送消息
    PUSH_MSG(9, "v4/timpush/push", "推送消息"),
    //单发推送
    PUSH_BATCH_MSG(10, "v4/timpush/batch", "单发推送"),
    //关注
    //关注用户
    FOLLOW_ADD(11, "v4/follow/follow_add", "关注用户"),
    //取消关注用户
    FOLLOW_DELETE(12, "v4/follow/follow_delete", "取消关注用户"),
    //拉取关注、粉丝与互关列表
    FOLLOW_GET(13, "v4/follow/follow_get", "拉取关注、粉丝与互关列表"),
    //检查关注关系
    FOLLOW_CHECK(14, "v4/follow/follow_check", "检查关注关系"),
    //获取用户的关注、粉丝与互关数
    FOLLOW_GET_INFO(15, "v4/follow/follow_get_info", "获取用户的关注、粉丝与互关数"),

    // 会话分组：创建会话分组数据 v4/recentcontact/create_contact_group
    CREATE_CONTACT_GROUP(21, "v4/recentcontact/create_contact_group", "创建会话分组数据"),

    ;

    @Getter
    private Integer code;
    @Getter
    private String name;
    @Getter
    private String url;

    ReqUrlEnums(Integer code, String url, String name) {
        this.code = code;
        this.name = name;
        this.url = url;
    }

    public static String getUrlByCode(Integer code) {
        for (ReqUrlEnums value : ReqUrlEnums.values()) {
            if (value.code.equals(code)) {
                return value.url;
            }
        }
        return null;
    }
}
